import { defineConfig } from 'vite'
import { resolve } from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [],
  build: {
    outDir: 'dist',
    lib: {
      entry: resolve(__dirname, 'bin/index.js'),
      formats: ['cjs'],
      fileName: 'index',
    },
    rollupOptions: {
      // 确保外部化处理那些你不想打包进库的依赖
      external: [
        'commander',
        'figlet',
        'inquirer',
        'fs-extra',
        'path',
        'git-clone',
        'ora',
        'chalk',
      ],
    },
  },
})
